import Taro from '@tarojs/taro'
export function queyElementYPosition(selector) {

    let query = Taro.createSelectorQuery()
    query.select(selector).boundingClientRect()
    query.selectViewport().scrollOffset()
    
    return new Promise((resolve, reject) => {
        query.exec(function(res){
            if(res[0]){
                resolve(res[0])
            }else{
                reject[res]
            }
        })
    })
}